$(document).ready(function(){
    $.ajax({
        url: '/person',
        type: 'get',
        data:"",
        dataType: 'json',
        error: function (error) {
            console.log(error);
            alert(error);
        },
        success: function (data) {
            $("#fabu_timu").html("");
            var tableStr = "<table>";

            tableStr = tableStr + "<thead><th>编号</th><th>论文名</th><th>导师</th><th>论文信息</th><th>删除</th></thead>";
            for (var i = 0; i < data.length; i++) {
                tableStr = tableStr + "<tr><td>" + data[i].pid + "</td>" + "<td>" + data[i].pname + "</td>" + "<td>" + data[i].teacher + "<td>" + data[i].info + "</td><td><button class='btn btn-danger btn-xs' id='"+data[i].num+"'>删除</button></td></tr>";
            }
            tableStr = tableStr + "</table>";
            //将动态生成的table添加的事先隐藏的div中.
            $("#fabu_timu").html(tableStr);
        }
    })}
)

